import request from '@/utils/request'
import { GET_ARTICLE } from '../actionsTypes'
export const getArticleList = (params) => {
  return async (dispatch) => {
    const res = await request({
      url: '/mp/articles',
      method: 'GET',
      params
    })
    // console.log(res)
    dispatch({ type: GET_ARTICLE, payload: res.data })
  }
}

export const delArticle = (id) => {
  return async () => {
    await request({
      method: 'delete',
      url: `/mp/articles/${id}`
    })
  }
}
